#pragma once
#include "IComputer.h"
#include <QObject>


namespace NOpenHardwareMonitor {

namespace NHardware {


class CComputerPrivate;
class CHardware;


class CComputer
	: public QObject
	, public IComputer
{
	Q_OBJECT


public:
	CComputer();
	~CComputer();


public:
	virtual void Open() override;
	virtual void Close() override;
protected:
	virtual void Release() override;


public:
	virtual QString GetReport() const override;

	virtual bool IsCPUEnabled() const override;
	virtual void CPUEnable(bool Enable) override;

	virtual bool IsGPUEnabled() const override;
	virtual void GPUEnable(bool Enable) override;

	virtual bool IsHDDEnabled() const override;
	virtual void HDDEnable(bool Enable) override;

	virtual bool IsMainboardEnabled() const override;
	virtual void MainboardEnable(bool Enable) override;

	virtual bool IsRAMEnabled() const override;
	virtual void RAMEnable(bool Enable) override;

	virtual bool IsFanControllerEnabled() const override;
	virtual void FanControllerEnable(bool Enable) override;

	virtual qint32 GetHardwareCount() const override;
	virtual IHardware* GetHardware(const qint32& Index) override;


private:
	void* GetHandle() const;


private:
	friend CHardware;


private:
	QScopedPointer<CComputerPrivate> d_ptr;
	Q_DECLARE_PRIVATE(CComputer)
};


}}